package com.huang.foundation.entity.request;

import com.huang.entity.request.MobileUtil;
import com.huang.entity.request.ParamCheck;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @Author HuangShen
 * @Date 2022/2/23 23:51
 * @Describe
 */
@Data
public class SendSmsRequest implements ParamCheck {

    // com.huang.foundation.entity.em.SmsType.code
    @ApiModelProperty("操作类型")
    private String type;
    @ApiModelProperty("电话号码")
    private String tel;

    @Override
    public void check() {
        // 参数校验
        if (!MobileUtil.checkPhone(tel)) {
         throw new RuntimeException("手机号号码格式错误");
        }
    }
}
